// utils/message.js
import { Message } from 'element-ui';

const types = ['success', 'warning', 'info', 'error'];

types.forEach(type => {
  Message[type] = (msg, opts = {}) => {
    return Message({
      message: msg,
      type,
      duration: 2000,
      showClose: false,
      ...opts
    });
  };
});

export default Message;
